import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Servidor 
{
  /**
  *
  * Classe que ofere os serviços para os clientes
  */
	public Servidor() throws RemoteException 
        {
		Service s = new ServiceImpl();
		try {
			Naming.rebind("//127.0.0.1:11099/Servidor", s);
			System.out.println("Servidor em Execucao..."); 
		} catch (MalformedURLException ex) 
                {
                    System.out.println(ex);
                    Logger.getLogger(Servidor.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
        
	public static void main(String args[]) throws RemoteException 
        { 
		new Servidor();
	}
}
